package vn.com.fsoft.model.entities;


import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

@Table(name = "GOVOFFICEREGION")
@Entity
public class GovOfficeRegion {
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "GOV_OFFICE_REGION_ID",unique=true,nullable=false)
	private int govOfficeRegionID;
	
	@Column(name = "GOV_OFFICE_REGION_NAME")
	private String govOfficeRegionName;
	

	@ManyToMany
	@JoinTable(name = "COUNTYGOVOFFICE", joinColumns = { @JoinColumn(name = "CG_GOVOFFICEREGIONID") }, inverseJoinColumns = { @JoinColumn(name = "CG_COUNTYID") })
	private Set<County> counties = new HashSet<County>(0);

	@Column(name = "DESCRIPT")
	private String description;

	@Column(name = "IS_ACTIVE")
	private int isActive;
	
	public GovOfficeRegion(){
		super();
	}


	public GovOfficeRegion(String govOfficeRegionName, String description, int isActive) {
		super();
		this.govOfficeRegionName = govOfficeRegionName;
		this.description = description;
		this.isActive = isActive;
	}

	public Set<County> getCounties() {
		return counties;
	}

	public void setCounties(Set<County> counties) {
		this.counties = counties;
	}
	public int getGovOfficeRegionID() {
		return govOfficeRegionID;
	}

	public void setGovOfficeRegionID(int govOfficeRegionID) {
		this.govOfficeRegionID = govOfficeRegionID;
	}

	public String getGovOfficeRegionName() {
		return govOfficeRegionName;
	}

	public void setGovOfficeRegionName(String govOfficeRegionName) {
		this.govOfficeRegionName = govOfficeRegionName;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getIsActive() {
		return isActive;
	}

	public void setIsActive(int isActive) {
		this.isActive = isActive;
	}

}
